home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_01_06
/
1n06039b
< prev
next >
Wrap
Text File
|
1990-10-01
|
459b
|
39 lines
Listing 5
/*
* scan.c
*/
#include <ctype.h>
#include <limits.h>
#include <stdio.h>
#include "scan.h"
int yylex(void)
{
int c;
while (isspace(c = getchar()) && c != '\n')
;
if (isdigit(c))
{
yylval = 0;
do
yylval = 10 * yylval + c - '0';
while (isdigit(c = getchar()));
ungetc(c, stdin);
return INT;
}
return c;
}
void yyrestart(void)
{
int c;
while ((c = getchar()) != '\n')
;
}